﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Solution.Business.Entities;

namespace Solution.Data
{
    public class UnitDAC
    {
        SolutionEntities context = SolutionEntities.Context;
        public List<Unit> Unit_GetByTop(string Top, string Where, string Ord)
        {
            var list = context.Unit_GetByTop(Top, Where, Ord);
            return list.ToList();
        }

        public void Unit_Insert(Unit unit)
        {
            context.Unit_Insert(unit.Name, unit.Order, unit.Active, unit.UnPosition);
        }

        public void Unit_Update(Unit unit)
        {
            context.Unit_Update(unit.UnId, unit.Name, unit.Order, unit.Active, unit.UnPosition);
        }
    }
}
